package com.qfedu.edu.slot.impl;

import com.qfedu.edu.slot.generate.GenerateSlot;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * @author xiaobobo
 * @title: LimitSlot
 * @projectName cd-fy-2401-third-project-parent
 * 需求:基于滑动时间窗口实现限流
 * 1、1分钟之内最多请求10次
 * 2、1小时之内最多请求100次
 * 3、1天之内最多请求300次
 * @description: TODO
 * @date 2024/9/23  15:34
 */
@Component
@Slf4j
public class LimitSlot extends GenerateSlot {

    @Override
    public int getOrder() {
        return Integer.MIN_VALUE + 1;
    }

    @Override
    public boolean dealReq(HttpServletRequest req) {
        log.info("限流检测....");
        return true;
    }
}
